#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/types.h>

int main(int argc, char *argv[])
{
	int z;		/* Status return code	*/
	int s[2];	/* Pair of Socket	*/

	/* Create pair of sockets		*/

	z = socketpair(AF_LOCAL, SOCK_STREAM, 0, s);

	/* Exit on fail				*/
	if(z == -1) {
		fprintf(stderr, "%s : socketpair(AF_LOCAL, SOCK_STREAM, 0)\n", strerror(errno));
		return 1;
	}

	/* Report the socket file desriptors returned	*/
	printf("s[0] = %d\n", s[0]);
	printf("s[1] = %d\n", s[1]);

	system("netstat --unix -p");

	return 0;
}
